package com.example.mythealthapp.guide

import android.view.View
import android.view.ViewGroup
import androidx.annotation.NonNull
import androidx.viewpager.widget.PagerAdapter

class GuideAdapter(var viewList: List<View>) :
    PagerAdapter() {
    override fun getCount(): Int {
        return viewList.size
    }

    override fun isViewFromObject(@NonNull view: View, @NonNull `object`: Any): Boolean {
        return view === `object`
    }

    @NonNull
    override fun instantiateItem(@NonNull container: ViewGroup, position: Int): Any {
        val view = viewList[position]
        container.addView(view)
        return view
    }

//    fun destroyItem(@NonNull container: ViewGroup, position: Int, @NonNull `object`: Any?) {
//        val view = viewList[position]
//        container.removeView(view)
//    }
}